package com.bishe.demo.modules.common.entity;

public class ResultEntity<T> {
    private int status;
    private String message;
    private T data;

   public enum ResultStatus {//使用枚举，给对应的返回状态增加约束条件
       SUCCESS(200),
       FAILED(500);

       public int code;

       ResultStatus(int code){
           this.code = code;
       }
   }

    public ResultEntity() {
    }

    public ResultEntity(int status, String message) {
        this.status = status;
        this.message = message;
    }

    public ResultEntity(int status, String message, T data) {
        this.status = status;
        this.message = message;
        this.data = data;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
